import wx, wx.html
import sys

class HtmlWindow(wx.html.HtmlWindow):
    def __init__(self, parent, id, size=(600,400)):
        wx.html.HtmlWindow.__init__(self,parent, id, size=size)
        if "gtk2" in wx.PlatformInfo:
            self.SetStandardFonts()

    def OnLinkClicked(self, link):
        wx.LaunchDefaultBrowser(link.GetHref())

class ResumeFrame(wx.Frame):
    def __init__(self, filepath, title = "Resume" ):
        wx.Frame.__init__(self, None, -1, title ,pos=(150,150), size=(350,200))
        self.Bind(wx.EVT_CLOSE, self.OnClose)

        sw = wx.ScrolledWindow(self)
        _htmlWin = HtmlWindow(sw, -1, size=(600,600))
        

        _htmlWin.LoadFile(filepath)
        self.SetClientSize(_htmlWin.GetSize())
        self.CentreOnParent(wx.BOTH)
        self.SetFocus()

    def OnClose(self, event):
        self.Destroy()
